let productid = getQueryString('productid')
let categoryid = getQueryString('categoryid')
fetch(`http://chst.vip:1234/api/getproduct?productid=${productid}`)
    .then(body => body.json())
    .then(res => {
        let el = ''

        res.result.forEach(item => {

            // 详情区 infon内容
            el += `<div class="pic">
        ${item.productImg}
    </div>
    <div class="title">${item.productName}</div>
    <div class="col">
        <span class="min">当前最低</span>
        <span class="price">￥6000</span>
        <span class="good">优选评论</span>
        <span class="num">82600条</span>
    </div>
    <div class="makeprice">${item.bjShop}</div>`

        })
        $('.info').html(el)
    })

// 评论区
fetch(`http://chst.vip:1234/api/getproductcom?productid=${productid}`)
    .then(body => body.json())
    .then(res => {
        let str = ''

        res.result.forEach(item => {
            str += `
           <div class="up">
               <span>${item.comName}</span>
               <span>${item.comTime}</span>
           </div>
           <div class="center">${item.comContent}</div>
           <div class="bot">
               <span>${item.comFrom}</span>
           </div>
       `
        })
        $('.content').html(str)
    })

fetch(`http://chst.vip:1234/api/getproductlist?categoryid=${categoryid}&productid=${productid}`)
    .then(body => body.json())
    .then(res => {
        // console.log(res.result)
        let el = ''
        res.result.forEach(item => {
    // console.log(res.result)
            el=item.brandName
            // console.log(el)
        })
        $('.tv').html(el)
    })
